--
-- Saca los espacios del codigo del grupo de limite para evitar errores posteriores
--
CREATE FUNCTION public.tg_padlimgru_ins_upd_cod()
    RETURNS trigger
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE NOT LEAKPROOF
AS $BODY$
DECLARE
vAux VARCHAR;
BEGIN
	NEW.Cod := trim(NEW.Cod);
	RETURN NEW;
END;
$BODY$;

ALTER FUNCTION public.tg_padlimgru_ins_upd_cod()
    OWNER TO abacouser;

CREATE TRIGGER padlimgru_ins_upd_cod
    BEFORE INSERT OR UPDATE 
    ON public.padlimgru
    FOR EACH ROW
    EXECUTE PROCEDURE public.tg_padlimgru_ins_upd_cod();
    
    
--
SELECT aaversion('497.03','497.02');
--

